/**
 * 
 */
package com.asset.salesforce.domain;

import java.io.UnsupportedEncodingException;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SessionImplementor;

/**
 * @author hisham
 *
 */
public class ContentStringType extends org.hibernate.type.StringType {
	   
	   private static final long serialVersionUID = 1L;
	   
	   @Override
	public Object get(ResultSet rs, String name, SessionImplementor session)
			throws HibernateException, SQLException {
		   String content=null;
		      try {
		         content= new String(rs.getBytes(name),"UTF-8");
		      } catch (UnsupportedEncodingException e) {
		         // TODO Auto-generated catch block
		         e.printStackTrace();
		      }
		         return content;
	}
	}
